function tail_1() {
	var id = $(".He_text_t").attr("id");
	$.ajax({
		url: "tail-1",
		data:{
			empid:id
		},
		success: function(data){
			for(var i=0;data.length>i;i++){
				var html = "<div class='ti tail_1' title='"+data[i]['pesname']+"' autho-rity='"+data[i]['pesurl']+"'><div class='tail_image tail_img_"+data[i]['pesid']+"'></div>"+data[i]['pesname']+"</div>";
				$(".cont_l_ta").append(html);
			}
		}
	});
}
function tail_2(text) {
	var id = $(".He_text_t").attr("id");
	$.ajax({
		url: "tail-2",
		data:{
			tatext:text,
			empid:id
		},
		success: function(data){
			for(var i=0;data.length>i;i++){
				var html = "<div class='ti tail_2' title='"+data[i]['funname']+"' autho-rity='"+data[i]['funurl']+"'>"+data[i]['funname']+"<div class='t_dn'></div></div>";
				$(".cont_l_ta").append(html);
				for(var j=0;data[i]['perPmsFuns'].length>j;j++){
					var html2 = "<div class='ti tail_3' title='"+data[i]['perPmsFuns'][j]['funsname']+"' autho-rity='"+data[i]['perPmsFuns'][j]['funsurl']+"' style='display: none;'>"+data[i]['perPmsFuns'][j]['funsname']+"</div>";
					$(".cont_l_ta").append(html2);
				}
			}
		}
	});
}
function up_dn_1(ta) {
	if($(".tail_1 .t_dn").length==0){
		for(var i=$(".tail_1").length-1;i>=0;i--){
			if(i!=ta.index()){
				$(".tail_1:eq("+i+")").remove();
			}else{
				$(".tail_1:eq("+i+") .tail_image").remove();
				$(".tail_1:eq("+i+")").append("<div class='t_dn'></div>");
			}
		}
		tail_2(ta.text());
	}else if($(".tail_1 .t_dn").length==1){
		$(".ti").remove();
		tail_1();
	}
}
//二级标签收放
function up_dn_2(ta) {
	var t = ta.next();
	if(ta.find("div").attr('class')=='t_up'){
		tai2_up(t);
		ta.find("div").attr('class','t_dn')
	}else if(ta.find("div").attr('class')=='t_dn'){
		tai2_dn(t);
		ta.find("div").attr('class','t_up')
	}
}
function tai2_up(t){
	for(;t.attr('class')=='ti tail_3';){
		t.slideUp(400);
		t = t.next();
	}
}
function tai2_dn(t){
	for(;t.attr('class')=='ti tail_3';){
		t.slideDown(400);
		t = t.next();
	}
}